package cn.hzking.gjmall.adpters.search;

import android.content.Intent;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.hzking.gjmall.R;
import cn.hzking.gjmall.activitys.second.SearchGoodListActivity;
import cn.hzking.gjmall.bean.SearchHotWordBean;

/**热词搜索
 * Created by Administrator on 2018/2/27.
 */

public class SearchHotWordAdater extends BaseQuickAdapter<SearchHotWordBean,BaseViewHolder> {
    public SearchHotWordAdater(int layoutResId, @Nullable List<SearchHotWordBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, final SearchHotWordBean item) {
        helper.setText(R.id.search_hotword,item.getHotWord());
        View itemView = helper.itemView;
        itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(mContext,SearchGoodListActivity.class);
                intent.putExtra("keyword",item.getHotWord());
                mContext.startActivity(intent);
            }
        });

    }
}
